<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理--招聘</title>
<link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript">

function addproject(){

    var url = "<c:url value="/ads/jobinfoList?m=add"/>";
    location=url;
}
function selectAll(obj){
	var array = document.getElementsByName("adsId");
	if(array){
		for(var i=0;i< array.length;i++){
			if(obj.checked){
				array[i].checked=true;
			}
			else{
				array[i].checked=false;
			}
		}
	}
}
function del(id){
	if(id!=0){
		location='<c:url value="/ads/adsdel?m=del&id="/>'+id;
	}
	else{
		var array = document.getElementsByName("adsId");
		var idstr="";
		for(var i=0;i<array.length;i++){
			if(array[i].checked){
				idstr+=array[i].value+",";
			}
		}
		if(idstr){
			location='<c:url value="/ads/adsdel?m=del&ids="/>'+idstr;
		}
		else{
			alert("您还为选择");
		}
	}
}
function search(){
	var key = document.getElementById("key");
	var menuId = document.getElementById("menuId");
	var url = "<c:url value="/ads/adssersh?m=list"/>";
	if(key.value!=""){
		url+="&key="+key.value;
	}
	if(menuId.value!=0){
		url+="&menuId="+menuId.value;
	}
	location=url;
}

</script>
</head>
<body>
<div class="content">
<jsp:include page="../pub/top.jsp"></jsp:include>
<!--头部结束-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="left" valign="top">
<jsp:include page="../pub/left_ads.jsp"></jsp:include>
</td>
<td valign="top">
	<div id="c01">
	<dl>
	<dt>关键字:<input type="text" class="qidian" id="key" name="key" value="${key}"/> </dt>
	<dd><input type="button" value="查询" class="chaxun" onclick="search()"/></dd>
        <dd><input style="margin-left: 30px" type="button" value="新增招聘" class="chaxun" onclick="addproject()"/></dd>

    </dl>
        <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dae2e5">
            <tr>
                <td width="5%" height="30" bgcolor="#e5edfa" align="center">ID</td>
                <td width="6%" height="30" bgcolor="#e5edfa" align="center">标题</td>
                <td width="10%" height="30" bgcolor="#e5edfa" align="center">城市</td>
                <td width="10%" height="30" bgcolor="#e5edfa" align="center">开始时间</td>
                <td width="10%" height="30" bgcolor="#e5edfa" align="center">结束时间</td>
                <td width="3%" height="30" bgcolor="#e5edfa" align="center">详情url</td>
                <td width="15%" height="30" bgcolor="#e5edfa" align="center">介绍</td>
                <td width="15%" height="30" bgcolor="#e5edfa" align="center">图片</td>
                <td width="15%" height="30" bgcolor="#e5edfa" align="center">置顶</td>
                <td width="6%" height="30" bgcolor="#e5edfa" align="center">操作</td>
            </tr>
            <c:choose>
                <c:when test="${not empty jobList}">
                    <c:forEach items="${jobList}" var="job" varStatus="vs">
                        <tr>
                            <td height="30" bgcolor="#FFFFFF" align="center">
                                <input type="checkbox" name="adsId" value="${job.id}"/>
                                <c:out value="${vs.index+1}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="left"><c:out value="${job.name}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.city}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.start_time}" /></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.end_time}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><a href="<c:out value="${job.url}"/>" ><c:out value="${job.url}"/></a></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.intro}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.img}"/></td>
                            <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${job.top}"/></td>
                                <%--<a href="<c:url value="/admin/news/news.do?m=edit&id=${news.id}"/>">修改</a> --%>
                            <td height="30" bgcolor="#FFFFFF" align="center">
                                <a href="<c:url value="/ads/jobinfoList?m=edit&id=${job.id}"/>">修改</a>
                                <a href="javascript:del(${job.id})">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                </c:when>
                <c:otherwise>
                    <tr>
                        <td colspan="6" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
                    </tr>
                </c:otherwise>
            </c:choose>
        </table>
	  <jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>
	</div>
	<br />
	<br />
</td>
</tr>
</table>
<jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
